/*
 * @Author: wangming
 * @Date: 2020-09-09 14:50:17
 * @LastEditors: wangming
 * @LastEditTime: 2021-03-31 14:10:17
 * @Description: file content
 */
import Vue from 'vue';
import template from './template';
class CreateInstance {
  constructor() {
    this.instance = null;
  }
  static create() {
    if (!this.instance) {
      const BenConstructor = Vue.extend(template);
      this.instance = new BenConstructor({
        el: document.createElement('div'),
      });
      document.body.appendChild(this.instance.$el);
    }
  }
  static addForm(...arg) {
    this.create();
    return this.instance.addForm(...arg);
  }
  static editForm(...arg) {
    this.create();
    return this.instance.editForm(...arg);
  }
}
export default CreateInstance;
